$ports = 5173,5174,8849
Get-NetTCPConnection -LocalPort $ports -ErrorAction SilentlyContinue | 
ForEach-Object { Stop-Process -Id $_.OwningProcess -Force }